package com.lcj.aoch.rule.controller.form;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@Schema(description = "预估代驾费用的表单")
public class EstimateOrderChargeForm {
  @NotBlank(message = "mileage不能为空")
  @Pattern(regexp = "^[1-9]\\d*\\.\\d+$|^0\\.\\d*[1-9]\\d*$|^[1-9]\\d*$", message = "mileage内容不正确")
  @Schema(description = "代驾公里数")
  private String mileage;
  
  @NotBlank(message = "time不能为空")
  @Pattern(regexp = "^(20|21|22|23|[0-1]\\d):[0-5]\\d:[0-5]\\d$", message = "time内容不正确")
  @Schema(description = "代驾开始时间")
  private String time;
  
  public EstimateOrderChargeForm(String mileage, String time) {
    this.mileage = mileage;
    this.time = time;
  }
  
  public EstimateOrderChargeForm() {}

  @Override
  public String toString() {
    return "EstimateOrderChargeForm(mileage=" + getMileage() + ", time=" + getTime() + ")";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this)
      return true; 
    if (!(o instanceof EstimateOrderChargeForm))
      return false; 
    EstimateOrderChargeForm other = (EstimateOrderChargeForm)o;
    if (!other.canEqual(this))
      return false; 
    Object this$mileage = getMileage(), other$mileage = other.getMileage();
    if ((this$mileage == null) ? (other$mileage != null) : !this$mileage.equals(other$mileage))
      return false; 
    Object this$time = getTime(), other$time = other.getTime();
    return !((this$time == null) ? (other$time != null) : !this$time.equals(other$time));
  }
  
  protected boolean canEqual(Object other) {
    return other instanceof EstimateOrderChargeForm;
  }

  @Override
  public int hashCode() {
    int PRIME = 59;
    int result = 1;
    Object $mileage = getMileage();
    result = result * 59 + (($mileage == null) ? 43 : $mileage.hashCode());
    Object $time = getTime();
    return result * 59 + (($time == null) ? 43 : $time.hashCode());
  }

}
